<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserProfilesTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('user_profile', function(Blueprint $table)
		{
			$table->increments('id');
			$table->timestamps();

			//关联tyw_users中的id
			$table->integer('uid');
			//用户昵称，长度为2-15个中文字，英文长度也是2-15，字段长度为40
			$table->string('nickname',40);
			//varchar 20 省代码
			$table->string('province',20);
			//varchar 20 市代码
			$table->string('city',20);
			//varchar 20 区代码
			$table->string('area',20);
			//varchar 255 详细地址
			$table->string('address');
			//varchar 255 头像文件名
			$table->string('avatar');

			$table->tinyInteger('sex');
			$table->string('contact_way');
			$table->string('email');

			$table->softDeletes();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('user_profiles');
	}

}
